from django.urls import path

from apps.users import views

urlpatterns = [

    path('register/', views.RegisterView.as_view(), name='register'),  # 注冊
    path('usernames/<str:username>/count', views.UsernameView.as_view(), name='usernames'),  # 用户名重复
    path('mobiles/<int:mobile>/count', views.mobileView.as_view(), name='mobiles'),  # 电话号重复
    path('email/<str:email>/count', views.emailView.as_view(), name='email'),  # 电话号重复
    path('login/', views.LoginView.as_view(), name='login'),  # 登陆
    path('logout/', views.LogoutView.as_view()),  # 退出登陆
    path('userinfo/', views.UserInfoView.as_view()),  # 用户中心
    path('nickname/', views.Nickname.as_view()),  # 修改昵称
    path('addresses/', views.CreateAddressView.as_view()),  # 新增、删除、查询地址
    path('addresses/<int:address_id>/', views.CreateAddressView.as_view()),  # 修改地址
    path('addresses/<int:address_id>/default/', views.AddressDefaultView.as_view()),  # 设置默认地址
    path('password/', views.ChangePasswordView.as_view()),  # 修改密码
    path('myorders/', views.MyorderView.as_view()),  # 我的订单
    path('addresses/<int:address_id>/title/', views.UpdateTitleAddressView.as_view()),  # 修改标题
    path('browse_histories/', views.UserBrowseHistory.as_view()),  # 浏览记录

]
